import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '首页默认进入',
    redirect: '/closure'
  },
  {
    path: '/closure',
    name: '闭包学习',
    component: resolve => require(['../pages/closure.vue'], resolve)
  },
  {
    path: '/es6Unique',
    name: '快速去重',
    component: resolve => require(['../pages/es6Unique.vue'], resolve)
  },
  {
    path: '/arrChange',
    name: '数组二维转一维',
    component: resolve => require(['../pages/arrChange.vue'], resolve)
  },
  {
    path: '/indexedDB',
    name: 'indexedDB存储',
    component: resolve => require(['../pages/indexedDB.vue'], resolve)
  },
  {
    path: '/shadowDom',
    name: '影子dom',
    component: resolve => require(['../pages/shadowDom.vue'], resolve)
  },
  {
    path: '/regularization',
    name: '正则',
    component: resolve => require(['../pages/regularization.vue'], resolve)
  },
  {
    path: '/jsCompile',
    name: 'js编译',
    component: resolve => require(['../pages/jsCompile.vue'], resolve)
  },
  {
    path: '/equalObject',
    name: '对象相等',
    component: resolve => require(['../pages/equalObject.vue'], resolve)
  }

   
  
]

export default new VueRouter({
  mode: 'history',
  routes
})